﻿using SqlSugar;
using System;

namespace SqlSugarDemo
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var db = new SqlSugarScope(new SqlSugar.ConnectionConfig()
            {
                ConnectionString = "Data Source=.;Initial Catalog=SAAS_BASE;Persist Security Info=True;User ID=sa;password=123;MultipleActiveResultSets=True;Connect Timeout=21;",
                DbType = DbType.SqlServer,
                IsAutoCloseConnection = true,

            });
            db.Aop.OnLogExecuting = (sql, p) =>
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine(sql);
                Console.ForegroundColor = ConsoleColor.White;
            };


            var list9 = db.Queryable<UserEntity>()
                          .Mapper<UserEntity, RoleEntity, UserRoleEntity>(it => ManyToMany.Config(it.UserId, it.RoleId)).In(new Guid("362eba7f-8e11-4c2e-8173-6d07e5dc2d0a")).Single();


            Console.WriteLine("用例跑完");
            Console.ReadKey();
        }
    }
}
